﻿@{
    const string AdminRoleName = "Admin";

    var userId = 0;
    if (User.Identity.IsAuthenticated)
    {
        var db = new DotNetUniLodz.Models.DotNetULEntities();
        var user = db.Users.FirstOrDefault(u => u.User_login == User.Identity.Name);
        if (user != null)
        {
            userId = user.User_id;
        }
    }
    
}
<ul>
    <li class="LinkOne"><a href="~/Home">Strona główna</a></li>
    <li class="LinkTwo"><a href="~/Articles">Aktualności</a></li>
    <li class="LinkThree"><a href="~/Events">Wydarzenia</a></li>
    @if (User.IsInRole(AdminRoleName))
    {
        <li class="LinkFour"><a href="~/Account">Użytkownicy</a></li>
    }
    <li class="LinkFive"><a href="~/Categories">Kategorie</a></li>
    @if (User.Identity.IsAuthenticated)
    {
        <li class="LinkSix">
            @Html.ActionLink("Moje konto", "Details", "Account", new { id = userId }, null)</li>
    }
</ul>
